package org.mdrtwell.jdk15;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class GenericTest<T> {
	private T	foo;

	public T getFoo() {
		return foo;
	}

	public void setFoo(T foo) {
		this.foo = foo;
	}

	public static void main(String[] args) {
		GenericTest<? extends List> gt = null;
		gt = new GenericTest<ArrayList>();
		gt = new GenericTest<LinkedList>();
		GenericTest<? super List> gt2 = null;
		gt2 = new GenericTest<Object>();
		GenericTest<String> gt3 = new GenericTest<String>();
		gt3.setFoo(" hello ");
		GenericTest<? extends Object> gt4 = gt3;
		System.out.println(gt4.getFoo());
		gt4.setFoo(null);
		System.out.println(gt4.getFoo());
		// gt4.setFoo(" world "); // �����ǲ�����ģ�
	}
}
